/*
 * Copyright 2008-2023 dexian.vip. All rights reserved.
 * Support: http://www.dexian.vip
 * License: http://www.dexian.vip/license
 */

package vip.dexian.admin.command;

import vip.dexian.core.base.command.BaseCommand;
import vip.dexian.core.base.validation.group.Save;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import java.io.Serial;

/**
 * 修改密码command
 *
 * @author 挺好的 2023年06月07日 9:45
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode (callSuper = false)
public class PasswordUpdateCommand extends BaseCommand {

    @Serial
    private static final long serialVersionUID = 6020512249000752396L;

    /**
     * 原密码
     */
    @NotBlank (message = "原密码不能为空", groups = {Save.class})
    @Length (message = "原密码的长度应在{min}和{max}个字符之间", min = 6, max = 60)
    private String oldPassword;

    /**
     * 新密码
     */
    @NotBlank (message = "新密码不能为空", groups = {Save.class})
    @Length (message = "新密码的长度应在{min}和{max}个字符之间", min = 6, max = 60)
    private String newPassword;
}
